![]() |
SetWindowBounds |
||||
Header: | MacWindows.h | Carbon status: | Supported | |
Sets a window’s size and position from the bounding rectangle of the specified window region.
OSStatus SetWindowBounds ( WindowRef window, WindowRegionCode regionCode, const Rect *globalBounds );
A pointer to the window whose bounds are to be set.
A constant specifying the region to be used in determining the window’s size and position. With Mac OS 8.5, the only valid values for the region code are kWindowStructureRgn and kWindowContentRgn.
Set the rectangle to specify the dimensions and position, in global coordinates, of the window region specified in the regionCode parameter.
A result code.
The SetWindowBounds function sets a window’s size and position to that specified by the rectangle that your application passes in the globalBounds parameter. After doing so, SetWindowBounds displays the window.
When you call the SetWindowBounds function, your application specifies whether the window’s content region or its structure region is more important in determining the window’s ultimate size and position. This distinction can be important with versions of the Mac OS running the Appearance Manager, since the total dimensions of a window—and, therefore, its spatial relationship to the rest of the screen—may vary from appearance to appearance. In general, you should specify kWindowStructureRgn for the regionCode parameter if how the window as a whole relates to a given monitor is more important than the exact positioning of its content on the screen. On the other hand, if you specify kWindowContentRgn for the regionCode parameter because the positioning of your application’s content is of greatest concern, then it is important to note that with some appearances some part of the window’s structure region or “frame” may extend past the edge of a monitor and not be displayed.
See also the function GetWindowBounds.
This function is available with Mac OS 8.5 and later.
Supported in Carbon. Available in CarbonLib 1.0 and later when WindowsLib 8.5 or later is installed. Exported by CarbonLib 1.0 and later and by WindowsLib 8.5 and later.
© 2000 Apple Computer, Inc. — (Last Updated 4/14/2000)